<%@page import="com.game.astd.web.LoginUnit"%>
<%@page import="com.game.astd.web.WebUtil"%>
<%@page import="com.game.astd.web.entity.JsonOpt"%>
<%@page import="org.json.JSONObject"%>
<%@page import="org.json.JSONArray"%>
<%@page import="java.io.PrintWriter"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
	JsonOpt jsonOpt = new JsonOpt(false);
	jsonOpt.setSuccess(true);
	try
	{
		String username = request.getParameter("name");
		String password = request.getParameter("password");
		System.out.println(username+"\t"+password);
		Map<String, String> userinfo = LoginUnit.login(username, password);
		System.out.println(userinfo);
		if (userinfo != null)
		{
			jsonOpt.setObj(true);
			request.getSession().setAttribute("_userinfo_", userinfo);
		} else
		{
			jsonOpt.setObj(false);
		}
	} catch (Exception x)
	{

	}
	response.setContentType(new StringBuilder("text/html; charset=").append("UTF-8").toString());
	out.print(jsonOpt.toString());
	out.close();
%>